package models

import "github.com/astaxie/beego/orm"

type PostTableid struct {
	Id int `orm:"column(pid);pk"`
}

func (m *PostTableid) TableName() string {
	return TableName("pre_forum_post_tableid")
}

func GetMaxId() (maxId PostTableid) {
	o := orm.NewOrm()
	qs := o.QueryTable("pre_forum_post_tableid")
	qs.OrderBy("-id").One(&maxId)
	return
}

func AddMaxId(m *PostTableid) (id int64, err error) {
	o := orm.NewOrm()
	id, err = o.Insert(m)
	return
}
